﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="产品入出库台账.aspx.cs" Inherits="syc.Store.产品入出库台账" %>
<html>
<head>
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
        //截止日期默认取当天
        $('#Date1').change(function() {
            if ($('#Date2').val() == "") {
                $('#Date2').val($('#Date1').val());
            }
        });
        //截止日期默认取当天
        $('#Date3').change(function() {
            if ($('#Date4').val() == "") {
                $('#Date4').val($('#Date3').val());
            }
        });
        //清空两个日期框
        $('#clear1').click(function() {
            $('#Date1').val("");
            $('#Date2').val("");
        });
        //清空两个日期框
        $('#clear2').click(function() {
            $('#Date3').val("");
            $('#Date4').val("");
        });
    });
						
</script>

    <form id="form1" runat="server">
    <div id="wintop" class="wintop">产品入出库台账</div>
    <asp:Panel ID="Panel1" runat="server" GroupingText="查 询" CssClass="panel">
        <span style="display:inline-block;width:220px;">
        产品类别：<asp:DropDownList ID="ChanPin" runat="server" Width="120px">
                    <asp:ListItem Value="1">油管</asp:ListItem>
                    <asp:ListItem Value="2">套管</asp:ListItem>
                </asp:DropDownList> 
        </span>
        <span style="display:inline-block;width:220px;">
        生产单位：<asp:DropDownList ID="FenChang" runat="server" Width="120px">
                    <asp:ListItem Value="0">全部</asp:ListItem>
                    <asp:ListItem Value="1">一分厂</asp:ListItem>
                    <asp:ListItem Value="2">二分厂</asp:ListItem>
                    <asp:ListItem Value="5">五分厂</asp:ListItem>
                </asp:DropDownList> 
        </span>
        
        <br />
        <span style="display:inline-block;width:220px;">
        原料供货：<asp:DropDownList ID="GongHuo" runat="server" 
            DataSourceID="SqlDataSource1" DataTextField="名称" DataValueField="ID" 
            Width="120px">
        </asp:DropDownList>
        </span>
        <span style="display:inline-block;width:220px;">
        订货单位：<asp:DropDownList ID="DingHuo" runat="server" 
            DataSourceID="SqlDataSource2" DataTextField="名称" DataValueField="ID" 
            Width="120px">
        </asp:DropDownList>
        </span>
        
        <br />
        <span style="display:inline-block;width:230px;">
        入库日期：<asp:TextBox ID="Date1" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date1').value, document.getElementById('Date1'));" />
        </span>
        至<span style="display:inline-block;width:200px;text-align:center;">
        <asp:TextBox ID="Date2" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date2').value, document.getElementById('Date2'));" />
        </span>
        <input type="button" class="smallbutton" id="clear1" value="清空日期"/>
        <br />
        <span style="display:inline-block;width:230px;">
        出库日期：<asp:TextBox ID="Date3" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date3').value, document.getElementById('Date3'));" />
        </span>
        至<span style="display:inline-block;width:200px;text-align:center;">
        <asp:TextBox ID="Date4" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date4').value, document.getElementById('Date4'));" />
        </span>
        <input type="button" class="smallbutton" id="clear2" value="清空日期"/>
        &nbsp; 
        <asp:Button ID="Button_Query" runat="server" Text="查 询" CssClass="button" onclick="Button_Query_Click"
            UseSubmitBehavior="False" />
        <asp:Button ID="Button_Export" runat="server" Text="导出台账" CssClass="button" 
                UseSubmitBehavior="False" OnClick="Button_Export_Click"/>
            
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
            SelectCommand="SELECT 0 as [ID], '全部' as [名称] UNION SELECT [ID], [名称] FROM [原料供货单位]"></asp:SqlDataSource>
            
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
            SelectCommand="SELECT 0 as [ID], '全部' as [名称] UNION SELECT [ID], [名称] FROM [产品订货单位]"></asp:SqlDataSource>
            
        <asp:Panel ID="Panel2" runat="server" CssClass="panel">
            <asp:Label ID="Label_Result" runat="server" Text="请点击“查询”按钮查询台账" ForeColor="Red"></asp:Label>
        </asp:Panel>
    
    </asp:Panel>

    
  <div class="gridframe">
        <div class="gridview">
        
            <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#d0d0d0">
	            <tr>
		            <td class="grid-title">产品入出库台账</td>
		        </tr>
		        <tr>
		            <td class="grid-back">
                        <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
                            onselected="SqlDataSource1_Selected" ></asp:SqlDataSource>
                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                            AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID" 
                            DataSourceID="SqlDataSource3" 
                            GridLines="None" ondatabound="GridView1_DataBound" 
                            onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
                            UseAccessibleHeader="False"  PageSize="20" >
                            <PagerSettings Visible="False" />
                            <RowStyle CssClass="grid-row-normal" />
                            <Columns>
                            
                               <asp:TemplateField HeaderText="原料供货单位" SortExpression="原料供货单位">
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("原料供货单位") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="120px" />
                                </asp:TemplateField>
                                
                               <asp:TemplateField HeaderText="入库序号" SortExpression="入库序号">
                                    <ItemTemplate>
                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("入库序号") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderText="入库日期" SortExpression="入库日期">
                                    <ItemTemplate>
                                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("入库日期","{0:d}") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                                </asp:TemplateField>  
                                
                                <asp:TemplateField HeaderText="炉号" SortExpression="炉号">
                                    <ItemTemplate>
                                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("炉号") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                                </asp:TemplateField>  

                                <asp:TemplateField HeaderText="支数" SortExpression="支数">
                                    <ItemTemplate>
                                        <asp:Label ID="Label5" runat="server" Text='<%# Eval("支数") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="36px" />
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderText="捆编号" SortExpression="捆号">
                                    <ItemTemplate>
                                        <asp:Label ID="Label6" runat="server" Text='<%# Eval("捆号") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="90px" />
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderText="捆重量(kg)" SortExpression="捆重量">
                                    <ItemTemplate>
                                        <asp:Label ID="Label7" runat="server" Text='<%# Eval("重量") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="70px" />
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="捆长度(m)" SortExpression="长度">
                                    <ItemTemplate>
                                        <asp:Label ID="Label8" runat="server" Text='<%# Eval("长度") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="70px" />
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderText="生产日期" SortExpression="生产日期">
                                    <ItemTemplate>
                                        <asp:Label ID="Label9" runat="server" Text='<%# Bind("生产日期","{0:d}") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                                </asp:TemplateField> 
                                
                                <asp:TemplateField HeaderText="库区" SortExpression="库区">
                                    <ItemTemplate>
                                        <asp:Label ID="Label10" runat="server" Text='<%# Eval("库区") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="36px" />
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="出库日期" SortExpression="出库日期">
                                    <ItemTemplate>
                                        <asp:Label ID="Label11" runat="server" Text='<%# Bind("出库日期","{0:d}") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                                </asp:TemplateField> 
                                
                                <asp:TemplateField HeaderText="发运方式" SortExpression="运输方式">
                                    <ItemTemplate>
                                        <asp:Label ID="Label12" runat="server" Text='<%# Bind("运输方式") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                                </asp:TemplateField> 
                                
                                <asp:TemplateField HeaderText="出库序号" SortExpression="出库序号">
                                    <ItemTemplate>
                                        <asp:Label ID="Label13" runat="server" Text='<%# Bind("出库序号") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                                </asp:TemplateField> 
                                
                            </Columns>
                            <SelectedRowStyle CssClass="grid-row-selected" />
                          </asp:GridView>
		            </td>
	            </tr>
	            <tr>
		            <td>   
		                <table width="100%">
		                    <tr>
		                        <td class="pagebar">
                                    <asp:Button ID="Button_Pager_First" runat="server" Text="" ToolTip="首页" 
                                        CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                    <asp:Button ID="Button_Pager_Prev" runat="server" Text="" ToolTip="上一页" 
                                        CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                    <input type="button" class="page-split" />第<asp:TextBox ID="TextBox_Pager" runat="server" CssClass="pageturn" 
                                        ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" /><asp:Label ID="Label_Pages" runat="server"></asp:Label><input type="button" class="page-split" />
                                    
                                    <asp:Button ID="Button_Pager_Next" runat="server" Text="" ToolTip="下一页" 
                                        CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                    <asp:Button ID="Button_Pager_Last" runat="server" Text="" ToolTip="末页" 
                                        CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" />
                                </td>
                                <td class="pagebar" align="right">
                                    <asp:Label ID="Label_Total" runat="server"></asp:Label>
                                </td>
                            </tr>
                       </table>

		            </td>
	            </tr>
            </table>
            

        </div>
    </div>
    
    
    
    
    
    
    
    
    </form>

<script>

</script>
</body>
</html>
